Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates to txfunc.py #932

Merged
merged 12 commits into from
Jun 7, 2024
Merged

Updates to txfunc.py #932

merged 12 commits into from
Jun 7, 2024

Conversation

jdebacker
Copy link
Member

This PR will make the following changes:

  1. Add another form for individual income tax functions from Heathcote, Storesletten, and Violante (QJE, 2017). It's helpful to add these because they are simple to estimate (one can use OLS), allow for progressive taxes, and are widely used in the macroeconomics literature.
  2. Improve the choice of starting values when minimizing tax functions via weighted, non-linear least squares.

@jdebacker
Copy link
Member Author

HSV function estimates (age specific, each line representing a different age)

ETRs

HSV_PUF_etr

MTR, labor income

HSV_PUF_mtrx

MTR, capital income

HSV_PUF_mtry

@codecov-commenter
Copy link

codecov-commenter commented May 18, 2024

Codecov Report

Attention: Patch coverage is 30.76923% with 54 lines in your changes missing coverage. Please review.

Project coverage is 72.44%. Comparing base (0261fbf) to head (3da5b4a).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #932      +/-   ##
==========================================
- Coverage   72.76%   72.44%   -0.32%     
==========================================
  Files          19       19              
  Lines        4644     4696      +52     
==========================================
+ Hits         3379     3402      +23     
- Misses       1265     1294      +29     
Flag Coverage Δ
unittests 72.44% <30.76%> (-0.32%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
ogcore/__init__.py 100.00% <100.00%> (ø)
ogcore/txfunc.py 30.58% <29.87%> (+1.05%) ⬆️

... and 1 file with indirect coverage changes

@jdebacker
Copy link
Member Author

Currently tests pass on Mac OS, fail on Linux (not yet run on Windows). Test failure is with the SSE from the regressions for the HSV functions. These are computed via simple matrix operations and thus I'm surprised there is any difference across platforms. @rickecon Any ideas why dot products would not be identical across platforms?

@jdebacker jdebacker marked this pull request as ready for review May 31, 2024 14:00
@jdebacker
Copy link
Member Author

@rickecon This PR is ready for your review.

The changes to starting values (which apply to the GS and DEP functions only) are to estimate the specified tax functions for all ages via a global optimizer (in this case, scipy.optimize.differential_evolution), then use these parameter estimates for the initial guess for the first age group. Following that, the parameter estimates for each age are used as starting values for the next age.

@jdebacker jdebacker requested a review from rickecon May 31, 2024 14:06
@rickecon
Copy link
Member

rickecon commented Jun 7, 2024

@jdebacker. The Linux/Python 3.10 test seems to be stalled out. I wonder what is going on with the tests. I am just waiting for these all to pass. I approved all the code changes.

@rickecon
Copy link
Member

rickecon commented Jun 7, 2024

@jdebacker. This looks great and all checks have passed. Merging.

@rickecon rickecon merged commit e762b06 into PSLmodels:master Jun 7, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants